#import "cocos2d.h"
#import "GameConfig.h"

#define kLayerMain 1

typedef enum tagGameState {
	kStateNone,
	kStateBegin,
	kStateResult,
	kStateFinish
} GameState;

@interface SceneMain : CCScene {
}
-(id)initWithMode:(int)mode time:(int)time;
@end

@interface LayerMain : CCLayer {
	CCSprite* mCircle1;			// 两个按钮
	CCSprite* mCircle2;
	CCSprite* mFinish;			// 提示文字
	CCSprite* mTips;
	CCSprite* mTimeBar;			// 时间条

	CCLabelTTF* mTimeValue;		// 时间文本
	CCLabelTTF* mScoreTotal;	// 分数文本
	CCLabelTTF* mScore1;
	CCLabelTTF* mScore2;

	TouchState mTouchState1;	// 点击状态
	TouchState mTouchState2;
	int mTouchCount1;			// 点击数
	int mTouchCount2;
	UITouch* mTouch1;			// 当前点击保留，为释放用
	UITouch* mTouch2;
	
	float mTime;				// 总时间
	NSDate* mStartTime;			// 开始时间戳

	int mMode;					// 模式
	
	CCMenuItemImage* mRetry;	// 两个按钮
	CCMenuItemImage* mBack;
	CCMenu* mMenu;				// 菜单
	
	GameState mGameState;		// 游戏状态
}

@property (retain, nonatomic)NSDate* mStartTime;

-(id)initWithMode:(int)mode time:(int)time;
-(int)containsTouchLocation:(UITouch *)touch;
-(void)drainTime;
-(void)reStart;
-(void)back;
-(void)retry;

@end
